Method and system for defect detection

ABSTRACT

A system, method and computer program product for defect detection, the method includes: (i) retrieving a second pixel of a second image that corresponds to a tested pixel of a first image of the object; wherein the first and second images were obtained using different acquisition methods; (ii) searching a third pixel of the second image such that a neighborhood of the second pixel is similar to a neighborhood of the third pixel; (iii) retrieving a fourth pixel of the first image that corresponds to the third pixel; and (iv) comparing between the tested pixel and the fourth pixel.

RELATED APPLICATIONS

This is a DIVISIONAL of U.S. patent application Ser. No. 11/831,675,filed Jul. 31, 2007, now U.S. Pat. No. 7,970,201 B2 which claims thepriority of U.S. provisional patent Ser. No. 60/820,924, filed Jul. 31,2006.

FIELD OF THE INVENTION

This invention is generally in the field of automatic optical inspectionof patterned articles, such as semiconductor wafers, printed circuitboards and reticles (also referred to as masks).

BACKGROUND OF THE INVENTION

Modern microelectronic devices are commonly produced using aphotolithographic process. In this process, a semiconductor wafer isfirst coated with a layer of a photoresist. This photoresist layer isthen exposed to illuminating light using a mask and subsequentlydeveloped. After the development, non-exposed photoresist is removed,and the exposed photoresist produces the image of the mask on the wafer.Thereafter, the uppermost layer of the wafer is etched. Thereafter, theremaining photoresist is stripped. For multilayer wafers, the aboveprocedure is then repeated to produce subsequent patterned layers.

Increasing the number of components in microelectronic circuits producedusing the above photolithographic process requires the use of very highresolution images in photoresist exposure.

It should be appreciated by those skilled in the art that to produce anoperational microelectronic circuit, a mask must be as defect-free aspossible, preferably completely defect-free. Therefore, mask inspectiontools are needed to detect various defects in the masks that canpotentially reduce the microelectronic circuit fabrication yields.

Certain kinds of mask defects (such as extra pattern, missing pattern orparticles can be detected by various inspection methods. A well knowndefect detection technique is known as die to die comparison. Die to diecomparison involves comparing an image of a die to an image of anotherdie. Die to die comparison is not effective in single die masks or innon-die areas of a mask.

There is a need to provide systems and methods for defect detection andespecially for defect detection of masks.

SUMMARY OF THE INVENTION

A method, computer readable medium and system for defect detection areprovided. Conveniently, one or more “tested” pixels are selected andthen one or more corresponding “reference” pixels are found. One or more“tested” pixels are compared to the one or more “reference” pixels inorder to find possible defects. Mismatch between a tested pixel to a“reference” pixel can indicate that a defect exists.

A method is provided. The method includes: selecting a tested pixel of afirst image of an object; retrieving a second pixel of a second imagethat corresponds to the tested pixel; wherein the first and secondimages were obtained using different acquisition methods; searching athird pixel of the second image such that a neighborhood of the secondpixel is similar to a neighborhood of the third pixel; retrieving afourth pixel of the first image that corresponds to the third pixel; andcomparing between the tested pixel and the fourth pixel.

A computer readable medium having computer-readable code embodiedtherein for defect detection, the computer-readable code comprisinginstructions for: selecting a tested pixel of a first image of anobject; retrieving a second pixel of a second image that corresponds tothe tested pixel; wherein the first and second images were obtainedusing different acquisition methods; searching a third pixel of thesecond image such that a neighborhood of the second pixel is similar toa neighborhood of the third pixel; retrieving a fourth pixel of thefirst image that corresponds to the third pixel; and comparing betweenthe tested pixel and the fourth pixel.

A system for defect detection, the system includes: a memory unitadapted to store information representative of neighborhoods of pixelswithin a first image of an object and within a second image of anobject; and a processor, coupled to the memory unit, the processor isadapted to: select a tested pixel of a first image of an object;retrieve a second pixel of a second image that corresponds to the testedpixel; wherein the first and second images were obtained using adifferent acquisition method; search a third pixel of the second imagesuch that a neighborhood of the second pixel is similar to aneighborhood of the third pixel; retrieve a fourth pixel of the firstimage that corresponds to the third pixel; and compare between thetested pixel and the fourth pixel.

A method, the method includes: retrieving a second pixel of a secondimage that corresponds to a tested pixel of a first image of the object;wherein the first and second images were obtained using differentacquisition methods; searching a third pixel of within multiple imagesof an object such that a neighborhood of the second pixel is similar toa neighborhood of the third pixel; retrieving a fourth pixel of thefirst image that corresponds to the third pixel; and comparing betweenthe tested pixel and the fourth pixel.

A method for defect detection, the method includes: retrieving a featureof a second image that corresponds to a first feature of a first imageof the object; wherein the first and second images were obtained usingdifferent acquisition methods; searching a third feature of the secondimage such that a neighborhood of the second feature is similar to aneighborhood of the third feature; retrieving a fourth feature of thefirst image that corresponds to the third feature; and comparing betweenthe first feature and the fourth feature.

A method for defect detection, the method includes: retrieving a secondpixel of a second image that corresponds to a tested pixel of a firstimage of the object; wherein the first and second images were obtainedusing different acquisition methods; searching a golden matching pixelof a second golden image such that a neighborhood of the golden matchingpixel is similar to a neighborhood of the third pixel; retrieving acorresponding golden pixel of a first golden image that corresponds tothe golden matching pixel; and comparing between the tested pixel andthe corresponding golden pixel.

Conveniently, the method includes searching for multiple pixels of thesecond image that have neighborhoods that match a neighborhood of thesecond pixel.

Conveniently, the method includes repeating the searching for multipletested pixels and generating statistics representative of number ofpixels found during the searching.

Conveniently, the method includes generating a synthetic image byreplacing tested pixels by reference pixels.

Conveniently, the computer-readable code including instructions for:retrieving a second pixel of a second image that corresponds to a testedpixel of a first image of the object; wherein the first and secondimages were obtained using different acquisition methods; searching athird pixel of within multiple images of an object such that aneighborhood of the second pixel is similar to a neighborhood of thethird pixel; retrieving a fourth pixel of the first image thatcorresponds to the third pixel; and comparing between the tested pixeland the fourth pixel.

Conveniently, the computer-readable code including instructions for:retrieving a feature of a second image that corresponds to a firstfeature of a first image of the object; wherein the first and secondimages were obtained using different acquisition methods; searching athird feature of the second image such that a neighborhood of the secondfeature is similar to a neighborhood of the third feature; retrieving afourth feature of the first image that corresponds to the third feature;and comparing between the first feature and the fourth feature.

Conveniently, the computer-readable code including instructions for:retrieving a second pixel of a second image that corresponds to a testedpixel of a first image of the object; wherein the first and secondimages were obtained using different acquisition methods; searching agolden matching pixel of a second golden image such that a neighborhoodof the golden matching pixel is similar to a neighborhood of the thirdpixel; retrieving a corresponding golden pixel of a first golden imagethat corresponds to the golden matching pixel; and comparing between thetested pixel and the corresponding golden pixel.

Conveniently, the computer-readable code includes instructions for:searching for multiple pixels of the second image that haveneighborhoods that match a neighborhood of the second pixel.

Conveniently, the computer-readable code includes instructions for:repeating the searching for multiple tested pixels and generatingstatistics representative of number of pixels found during thesearching.

Conveniently, the computer-readable code includes instructions forgenerating a synthetic image by replacing tested pixels by referencepixels.

A system for defect detection, the system includes: a memory unitadapted to store information representative of neighborhoods of pixelswithin a first image of an object and within a second image of anobject; and a processor, adapted to: retrieve a second pixel of a secondimage that corresponds to a tested pixel of a first image of the object;wherein the first and second images were obtained using differentacquisition methods; search a golden matching pixel of a second goldenimage such that a neighborhood of the golden matching pixel is similarto a neighborhood of the third pixel; retrieve a corresponding goldenpixel of a first golden image that corresponds to the golden matchingpixel; and compare between the tested pixel and the corresponding goldenpixel.

Conveniently, the processor is adapted to search for multiple pixels ofthe second image that have neighborhoods that match a neighborhood ofthe second pixel.

Conveniently, the processor is adapted to repeat the searching formultiple tested pixels and generate statistics representative of numberof pixels found during the searching.

Conveniently, the processor is adapted to wherein the processor isfurther adapted to generate a synthetic image by replacing tested pixelsby reference pixels.

A system for defect detection, the system includes: a memory unitadapted to store information representative of neighborhoods of pixelswithin a first image of an object; and a processor, coupled to thememory unit, the processor is adapted to: retrieve a second pixel of asecond image that corresponds to a tested pixel of a first image of theobject; wherein the first and second images were obtained usingdifferent acquisition methods; search a third pixel of within multipleimages of an object such that a neighborhood of the second pixel issimilar to a neighborhood of the third pixel; retrieve a fourth pixel ofthe first image that corresponds to the third pixel; and compare betweenthe tested pixel and the fourth pixel.

A system for defect detection, the system includes: a memory unitadapted to store information representative of neighborhoods of pixelswithin a first image of an object; and a processor, coupled to thememory unit, the processor is adapted to: retrieve a feature of a secondimage that corresponds to a first feature of a first image of theobject; wherein the first and second images were obtained usingdifferent acquisition methods; search a third feature of the secondimage such that a neighborhood of the second feature is similar to aneighborhood of the third feature; retrieve a fourth feature of thefirst image that corresponds to the third feature; and compare betweenthe first feature and the fourth feature.

BRIEF DESCRIPTION OF THE DRAWINGS

In order to understand the invention and to see how it may be carriedout in practice, an embodiment will now be described, by way ofnon-limiting example only, with reference to the accompanying drawings,in which:

FIG. 1 illustrates two images, few pixels and few neighborhoods of thesefew pixels according to an embodiment of the invention;

FIG. 2 illustrates few neighborhoods of a pixel according to anembodiment of the invention;

FIG. 3A is a flow chart of a method for generating a first and secondimage data structures, according to an embodiment of the invention;

FIG. 3B is a flow chart of a method for generating a first image datastructure, according to an embodiment of the invention;

FIG. 4 is a flow chart of a method for defect detection, according to anembodiment of the invention;

FIGS. 5-6 are flow charts of methods for defect detection, according toan embodiment of the invention:

FIG. 7 illustrates a reflective image of a mask, a transmissive image ofthe mask and a defect map, according to an embodiment of the invention;and

FIG. 8 illustrates a system for detecting defects, according to anembodiment of the invention; and

FIG. 9 illustrates four images, few pixels and few neighborhoods ofthese few pixels according to another embodiment of the invention.

DETAILED DESCRIPTION OF EXEMPLARY EMBODIMENTS

System, method and computer program products are provided. Defects canbe found by analyzing two images of the same object that were acquiredby using different acquisition methods. These two images can include areflected image and a transmissive image of the same object.

The system, method and computer program product can be used to find softdefects on non-die areas of a mask.

The method, system and computer program product can detect defects thatare visible only on one of the two images.

The method, system and computer program product utilize the followingassumption: on a defect-free object, two locations that are similar inone image are also similar in the second image. If a defect appears inone image the similarity between locations is violated.

For simplicity of explanation, the following description will refer toan analysis of a transmitted image and of a reflected image of the sameobject. Those of skill in the art will appreciate that the method,system and computer program product can be applied mutatis mutandis toother image acquisition methods that differ from each other.

FIG. 1 illustrates two images. Each image includes a very large numberof pixels, out of which only few pixels are shown. It is noted that thisfigure as well as other figures are out of scale.

First image I1 21 includes multiple pixels, such as but not limited totested pixel 1, fourth pixel 4, sixth pixel 6 and seventh pixel 7.Second image I2 22 includes multiple pixels, such as but not limited tosecond pixel 2, third pixel 3, fifth pixel 5 and eighth pixel 8.

First till eighth pixels 1-8 are surrounded by multiple neighboringpixels to form multiple neighborhoods 11-18. It is noted that althoughsquare shaped neighborhoods are shown other shaped neighborhoods can beused.

It is noted that the terms “second”, “third”, “fourth”, “fifth”.“sixth”, “seventh” and “eighth” used in conjunction to pixels is forconvenience only. These terms do not represent metadata such as apriority level, location related information and the like.

FIG. 2 illustrates few neighborhoods 11, 11′ and 11″ of pixel 1according to various embodiments of the invention.

Neighborhood 11″ includes nine fine resolution pixels and is centeredabout tested pixel 1. Neighborhood 11′ includes nine coarse resolutionpixels and is centered about tested pixel 1. Neighborhood 11 is acombination of the nine coarse resolution pixels of neighborhood 11′ andof the nine fine resolution pixels of neighborhood 11″.

Conveniently, neighborhoods 11 and 11′ are represented by a vector thatincludes nine elements—an element per pixel. Neighborhood 11 isrepresented by a vector that includes eighteen elements—an element perpixel. Each vector element can be an intensity value of a single pixelbut this is not necessarily so. It is further noted that the shape and,alternatively or additionally, the number of pixels within neighborhoods11 and 11′ can differ from each other.

Using fine resolution pixels provides a better description of a smallerarea in relation to using coarse resolution pixels. Representing aneighborhood by both coarse and fine pixels enables to represent alarger area around a pixel while providing more detailed informationabout the close vicinity of that pixel.

The fine resolution can differ from the coarse resolution by apredefined factor. Factors of about two to four can be selected but thisis not necessarily so.

It is further noted that although FIG. 2 illustrates a nine or aneighteen pixel neighborhood that larger (or smaller) neighborhoods canbe selected.

It is noted that the first and second images can be images of an area ofa mask that includes scribe lines or other regions that can not beanalyzed by applying die to die or cell to cell analysis. It is furthernoted that other locations of the mask can be analyses by other defectdetection methods such as die to die comparison, cell to cell comparisonand the like.

It is further noted that various areas of the mask can be analyzed byapplying simpler detection methods that are designated for special maskareas, such as clear areas, lines, contacts etc. This combinationreduces the overall time complexity of the solution.

FIG. 3A is a flow chart of method 400 for generating a first and secondimage data structures, according to an embodiment of the invention.

Method 400 starts by stage 410 of receiving a first image and a secondimage of the same object that were acquired by using different imageacquisition methods.

For example, the certain image can be acquired by using high NA opticswhile the other image can be acquired using low NA optics, the certainimage can be acquired by using bright field illumination and the otherimage can be acquired using dark field illumination, the first and otherimages can have different pixels sizes, can be characterized bydifferent resolution, the certain image can be acquired while the otherimage can be a golden image, a selected image (from history), a databaserepresentation and the like.

Stage 410 is followed by stage 420 of selecting selected pixels withinthe first image and within the second image.

The selected pixels can be selected such as to represent features thatare expected to appear in the first image. The selection can be executedautomatically, manually (in response to user feature definitions or userpixel selection) or semi-automatically. The selection an be responsiveto various parameters such as memory size constraints, processorconstraints, speed of data structure retrieval, number and complexity offeature of interest, and the like. It is noted that multiple pixels ofthe second image are also selected and their neighborhoods (or a lowerdimension representation of their neighborhoods) are stored in a secondimage data structure.

The selection can also be responsive to a defect detection method thatshould be applied to detect various defects. The selection betweendefect detection methods can be based upon a resource consumption levelof the defect detection method and a suitableness of the defectdetection method to find a defect. For example, certain areas of themask can be analyzed by using simpler detection methods that aredesignated for special mask areas, such as clear areas, lines, contactsetc. In this case pixels that belong to such areas (so called “otherpixels) are analyzed using another detection scheme, as illustrated bystage 340.

Stage 420 is followed by stage 430 of generating representations ofneighborhoods of the selected pixels. This can include applying acompression scheme that converts M element vectors that represents aneighborhood to an N-dimensional representation. N is smaller than M.

Stage 430 is followed by stage 440 of arranging these neighborhoods (orlower dimension representations of these neighborhoods) at a first imagedata structure and at a second image data structure. It is noted thatthe first image data structure and the second image data structure canbe characterized by a fast retrieval time. For example, these datastructures can be multiple-dimensional KD-trees which support fastnearest-neighbor searching.

FIG. 3B is a flow chart of method 401 for generating a second image datastructure, according to an embodiment of the invention.

Method 401 differs from method 400 by generating only a second imagedata structure. Method 401 can be applied during defect evaluation ofthe first image.

Method 401 starts by stage 411 of receiving a second image of an object.

Conveniently, a first image that is being evaluated (especially—defectswithin the first image are being detected and evaluated) is alsopresent. The first and second images of the same object were acquired byusing different image acquisition methods.

Stage 411 is followed by stage 421 of selecting selected pixels withinthe second image.

Stage 421 is followed by stage 431 of generating representations ofneighborhoods of the selected pixels.

Stage 431 is followed by stage 441 of arranging these neighborhoods (orlower dimension representations of these neighborhoods) at a secondimage data structure. It is noted that the second image data structurecan be characterized by a fast retrieval time. For example, these datastructures can be multiple-dimensional KD-trees which support fastnearest-neighbor searching.

FIG. 4 is a flow chart of method 300 for defect detection, according toan embodiment of the invention. FIGS. 5-6 illustrates methods 100 and200 for detecting defects according to an embodiment of the invention.FIG. 5 illustrates stages 150-180 that are applied in relation to atested pixel of a first image. FIG. 6 illustrates stages 250-280 thatare executed in relation to a fifth pixel of the second image.

Referring to FIG. 4, method 300 starts by either one of stages 310 and320.

Stage 310 represent a generation of a first image and second image datastructures while stage 320 illustrates a reception of these datastructures. Stage 310 can include applying various stages of method 400.Stage 320 can include receiving data structures that were generated byapplying various stages of method 400.

After stages 310 and 320 are completed the analysis begins. The analysisis done on a pixel to pixel basis, as illustrated by stage 330 thatfollows stages 310 and 320.

Stage 330 includes selecting a pixel to evaluate—selecting a “new”tested pixel.

Stage 330 is followed by stage 340 of analyzing the “new” tested pixelby applying a similarity based defect detection scheme. Stage 340 caninclude applying stages of method 100 (of FIG. 5), and additionally oralternatively, applying stages of method 200 (of FIG. 6).

Stage 340 is followed by stage 350 of checking if more pixels should beexamined—“any more pixels to evaluate by applying the similarity baseddefect detection scheme?”.

If the answer is positive then stage 350 is followed by stage 330 ofselecting a new tested pixel. Else stage 350 can be followed by stage360 of providing a map of first image suspected defects and a map of asecond image suspected defects. It is noted that method 300 can beapplied to find defects in a single image out of the first and secondimages and in this case the outcome of stage 360 is a single imagesuspected defects map.

Those of skill in the art will appreciate that the results of thesimilarity based defect detection scheme can be provided in othermanners and that a map is provided as a sample only. The map can includemultiple map pixels, each having a value indicative of the differencebetween pixels of the same image.

Method 100 of FIG. 5 starts by stage 150 of retrieving within the secondimage a second pixel that corresponds to a tested pixel within the firstimage.

According to an embodiment of the invention the tested pixel can beselected by a user, by an automatic process and the like. The testedpixel can be selected in view of the expected structure of the mask,potentially defect prone regions. The tested pixel can also represent anarbitrary pixel within the first image. If, for example all pixelswithin the first image are analyzed then the tested pixel can representany pixel within the first image.

The first and second pixels should represent that same location withinthe object. Stage 150 can be preceded by a registration of the first andsecond images.

Stage 150 is followed by stage 160 of searching a third pixel of thesecond image such that a neighborhood of the second pixel is similar toa neighborhood of the third pixel. If such a third pixel is not foundmethod 100 can end or a “new” tested pixel can be selected and stages160-180 can be repeated for this new pixel. If such a third pixel is notfound a default comparison result can be generated and stored. Referringto FIG. 1, it is assumed that third pixel 3 having neighborhood 13 isfound. Neighborhood 13 of third pixel 3 can be the approximate nearestneighborhood of neighborhood 11 of tested pixel 1.

Stage 160 conveniently includes stages 162 and 164. Stage 162 includesgenerating an N-dimensional representation of the neighborhood of thesecond pixel. Stage 164 includes searching an N-dimensional KD-tree fora neighborhood of a third pixel that is an approximate nearestneighborhood of the neighborhood of the second pixel.

It is noted that other data structure other than N-dimensional KD-treescan be searched and that other algorithms that approximate nearestneighbors can be applied.

If such a third pixel is found then stage 160 is followed by stage 170of retrieving a fourth pixel of the first image that corresponds to thethird pixel. The third and fourth pixels should represent that samelocation within the object.

Stage 170 is followed by stage 180 of comparing between the tested pixeland the fourth pixel. If these pixels are similar to each other then itis assumed that that there is no defect, else (if these pixels are notsimilar) it is assumed that a defect was found. It is noted that stage180 can also include comparing between the neighborhoods of the testedpixel and the fourth pixel, comparing between some pixels of theseneighborhoods and the like. The comparison can include comparing anintensity of each pixel, an energy of each pixel and the like.

It is noted that a defect can be announced by comparing more than twopixels that represent ideally similar features.

Conveniently, the comparison includes (or is preceded by) a sub-pixelregistration between the neighborhoods of the first and fourth pixelsand that the neighborhoods can be further processed in order to remove(or reduce) noise, visual artifacts and the like.

It is noted that the same process can be applied on pixels of the secondimage. It is further noted that in many cases pixels of the first andsecond images will be evaluated, but this is not necessarily so.

Method 200 of FIG. 6 includes stage stages 250-280 that are analogues tostages 150-180 of method 100.

Method 200 starts by stage 250 of retrieving a sixth pixel of the firstimage that corresponds to a fifth pixel of the first image.

Stage 250 is followed by stage 260 of searching a seventh pixel of thefirst image such that a neighborhood of the seventh pixel is similar toa neighborhood of the sixth pixel. If such a seventh pixel is not foundmethod 200 can end or a “new” fifth pixel can be selected and stages260-280 can be repeated for the new fifth pixel. If such a seventh pixelis not found a default comparison result can be generated and stored.

If such a seventh pixel is found then stage 260 is followed by stage 270of retrieving within the second image an eighth pixel that correspondsto the seventh pixel. The seventh and eighth pixels should representthat same location within the object.

Stage 270 is followed by stage 280 of comparing between a neighborhoodof the fifth pixel and the neighborhood of the eighth pixel. If theseneighborhoods are similar to each other then it is assumed that thatthere is no defect, else (if these neighborhoods are not similar) it isassumed that a defect was found.

Those of skill in the art will appreciate that stages 250-280 can beapplied during a defect detection method that is analogues to method 300of FIG. 4. In this case instead of looking for tested pixels within thefirst image tested pixels will be searched in the second image.

FIG. 7 illustrates a transmissive image 410 of a mask, a reflectiveimage 420 and circles that surround suspected defects and map 430 thatrepresents the appliance of method 100 on substantially all the pixelsof the reflective image 420.

FIG. 8 illustrates system 60 according to an embodiment of theinvention. System 60 is capable of acquiring transmissive and reflectiveimages of mask 66 and processing the images by applying a similaritybased detection scheme such as method 100, 200 or 300.

It is noted that a processor that is not a part of such a system canapply the similarity based detection scheme, after receiving reflectiveand transmissive images of the mask.

System 60 includes reflective light source 74, transmissive light source72, objective lens 82, beam splitter 84, optics 86, detector unit 88,processor 90 and memory unit 92. Additionally or alternatively, a singlelight source and multiple detectors (above and below mask 60) can beused.

Light from reflective light source 74 is directed, via beam splitter 84towards mask 60. Light from transmissive light source 72 passes throughmask 60. Light (reflected or transmitted—depends upon the light sourcethat is activated) passes through objective lens 82, beam splitter 84and optics 86 to be detected by detector unit 88. Detection unit 88 canprovide frames representative of parts of mask 60. An image of mask 60or a part of mask 60 can be formed from at least a portion of a frame.

Memory unit 92 can store the images and, additionally or alternatively,store information representative of neighborhoods of pixels within afirst image of an object and within a second image of an object.

Processor 90 is connected to memory unit 92. Processor 90 is adapted to:(i) retrieve a second pixel of a second image that corresponds to atested pixel of a first image of the object: wherein the first andsecond images were obtained using a different acquisition method; (ii)search a third pixel of the second image such that a neighborhood of thesecond pixel is similar to a neighborhood of the third pixel; (iii)retrieve a fourth pixel of the first image that corresponds to the thirdpixel; and compare between the tested pixel and the fourth pixel.

Optics 86 can include an aperture, a focusing lens (such as a tubelens), zoom magnification lens, and another beam splitter (if, forexample, detection unit 88 includes multiple spaced apart cameras, asillustrated in U.S. Pat. No. 7,133,548 which is incorporated herein byreference.

Each of the various mentioned above methods can be executed by acomputer that executed a computer program stored in a computer readablemedium.

The mentioned above description refers to a selection of tested pixelsand a comparison of a tested pixel to a reference pixel. It is notedthat the invention can be applied mutatis mutandis on features. Thus, atested feature can be selected, a corresponding feature is retrievedfrom another image of the object, a similar feature is searched in theother image and once found a reference feature can be retrieved andcompared to the tested feature.

The mentioned above description refereed to a comparison of pixelswithin a first and a second image. According to an embodiment of theinvention each image represents a portion of a mask and the similaritybased search is not bounded to the second image but rather can beexpanded to finding within multiple images of different portions of thereticle a pixel that has similar neighborhoods. Accordingly, a datastructure of multiple images can be generated.

The mentioned above description referred to a comparison of pixelswithin a first and a second image. According to an embodiment of theinvention a database or “golden” images are used in order to finddefects. A first “golden” image can represent a defect free (ideal)reticle as imaged during an acquisition method that is applied toacquire the first image. A second “golden” image can represent a defectfree (ideal) reticle as imaged during an acquisition method that isapplied to acquire the second image. Instead of applying the similaritybased search within the second image the similarity based searchsearches for a matching pixel (golden matching pixel) within the second“golden” image that has a neighborhood that is similar to a neighborhoodof a second pixel located within the second image. After the goldenmatching pixel is found a corresponding golden pixel (within the first“golden” image) is retrieved. The location of the golden matching pixelis the same as the location of the corresponding golden pixel. Thecorresponding golden pixel is then compared to the tested pixel. Ifthese pixels differ from each other (a threshold based decision can beapplied) then the tested pixel can represent a defect. In this case thetested pixel is the tested pixel and the corresponding golden pixel isthe reference pixel. It is noted that a similar process can be appliedwhen pixels of the second image are evaluated.

FIG. 9 illustrates first golden image G1 21′, second golden image G2 22,first and second pixels 1 and 2 and their neighborhoods 11 and 12,golden matching pixel 3′ and its neighborhood 13′, corresponding goldenpixel 4′ and its neighborhood 14′. Tested pixel 1 is selected as atested pixel. Second pixel 2 is retrieved as being at the same location(in second image I2 22) as tested pixel 1 within first image I1 21.Golden matching pixel 3′ (within second golden image G2 22′) is foundafter searching a pixel (within second golden image) that has a similarneighborhood to the neighborhood of second pixel 2. Corresponding goldenpixel 4′ is retrieved and has the same location (within first goldenimage G1 21′) as the location of Golden matching pixel 3′. Correspondinggolden pixel 4′ is the reference pixel of tested pixel 1 and is comparedto tested pixel in order to detect a defect.

According to an embodiment of the invention the similarity based searchcan try to locate multiple similar pixels per target pixel. The processcan continue by generating statistics representing a relationshipbetween pixels and the number (or other attribute) of similar(reference) pixels.

According to another embodiment of the invention a synthetic image isgenerated. In this synthetic image reference pixels replace the targetpixels and vice verse. Target pixels that do not have similar pixels canbe filtered out.

Those skilled in the art will readily appreciate that variousmodifications and changes can be applied to the embodiments of theinvention as hereinbefore described without departing from its scopedefined in and by the appended claims.

1. A method for defect detection, the method comprising: retrieving asecond pixel of a second image of an object that corresponds to a testedpixel of a first image of the object; wherein the first and secondimages were obtained using different acquisition methods; searching agolden matching pixel of a second golden image such that a neighborhoodof the golden matching pixel is similar to a neighborhood of the secondpixel; retrieving a corresponding golden pixel of a first golden imagethat corresponds to the golden matching pixel; comparing between thetested pixel and the corresponding golden pixel; and identifying defectsin the object based on the comparison, wherein each respective goldenmatching pixel and golden pixel of a golden image is a pixel of an imagerepresenting a defect-free object.
 2. The method according to claim 1further comprising repeating the searching for multiple tested pixelsand generating statistics representative of a number of pixels foundduring the searching.
 3. A non-transitory computer readable mediumhaving computer readable code for defect detection embodied therein, thecomputer-readable code comprising instructions for: retrieving a secondpixel of a second image of an object that corresponds to a tested pixelof a first image of the object; wherein the first and second images wereobtained using different acquisition methods; searching a goldenmatching pixel of a second golden image such that a neighborhood of thegolden matching pixel is similar to a neighborhood of the second pixel;retrieving a corresponding golden pixel of a first golden image thatcorresponds to the golden matching pixel; comparing between the testedpixel and the corresponding golden pixel; and identifying defects in theobject based on the comparison, wherein each respective golden matchingpixel and golden pixel of a golden image is a pixel of an imagerepresenting a defect-free object.
 4. The computer readable medium ofclaim 3 wherein the computer-readable code comprises instructions for:searching for multiple pixels of the second image that haveneighborhoods that match a neighborhood of the second pixel.
 5. Thecomputer readable medium of claim 4 wherein the computer-readable codecomprises instructions for: repeating the searching for multiple testedpixels and generating statistics representative of a number of pixelsfound during the searching.
 6. The computer readable medium of claim 3wherein the computer-readable code comprises instructions for:generating a synthetic image by replacing tested pixels by referencepixels.
 7. A system for defect detection, the system comprising: amemory unit adapted to store information representative of neighborhoodsof pixels within a first image of an object and within a second image ofthe object; and a processor, adapted to: retrieve a second pixel of asecond image of the object that corresponds to a tested pixel of a firstimage of the object; wherein the first and second images were obtainedusing different acquisition methods; search a golden matching pixel of asecond golden image such that a neighborhood of the golden matchingpixel is similar to a neighborhood of the second pixel; retrieve acorresponding golden pixel of a first golden image that corresponds tothe golden matching pixel; and compare between the tested pixel and thecorresponding golden pixel, wherein each respective golden matchingpixel and golden pixel of a golden image is a pixel of an imagerepresenting a defect-free object.
 8. The system according to claim 7wherein the processor is adapted to search for multiple pixels of thesecond image that have neighborhoods that match a neighborhood of thesecond pixel.
 9. The system according to claim 8 wherein the processoris adapted to repeat the searching for multiple tested pixels andgenerate statistics representative of a number of pixels found duringthe searching.
 10. The system according to claim 7 wherein the processoris adapted to identify defects in the object based on the comparison.